//
//  XS_ApplyItemCell.swift
//  XueDao
//
//  Created by Mac on 2020/12/10.
//

import UIKit

class XS_ApplyItemCell: UICollectionViewCell {

    @IBOutlet weak var titleLabel: UILabel!
    @IBOutlet weak var timeBtn: QMUIButton!
    @IBOutlet weak var locationBtn: QMUIButton!
    @IBOutlet weak var stateLabel: UILabel!
    @IBOutlet weak var openStateLabel: UILabel!
    
    var _model : XS_ApplyItemModel!
    public var model : XS_ApplyItemModel!{
        set{
            _model = newValue
            //设置数据
            titleLabel.text = newValue.name
            timeBtn.setTitle(newValue.startTime + "-" + newValue.endTime, for: .normal)
            locationBtn.setTitle(newValue.address + newValue.detailAddress, for: .normal)
            stateLabel.text = Int(newValue.orderState) == 1 ? "已付款" : "待付款"
//            openStateLabel.isHidden = newValue.startTime
        }
        get{
            return _model
        }
    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
        timeBtn.imagePosition = .left
        locationBtn.imagePosition = .left
        timeBtn.spacingBetweenImageAndTitle = 8
        locationBtn.spacingBetweenImageAndTitle = 8
    }

    @IBAction func contactBtnAction(_ sender: UIButton) {
        
    }
}
